﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using ApiTest.Entitys;

using Apps.Shared.IServices;

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace ApiTest2.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class TestController : ControllerBase
    {
        [MtpResource]
        public readonly IGoodsService goodsService;

        [Get]
        public Goods Get()
        {
            return goodsService.Test();
        }

        /// <summary>
        /// 授权
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [Auth(false)]
        public string AccessTokenTest()
        {
            return this.CreartTicket(new AdminToken() { AdminId = 1 }, 3600 * 24);
        }
    }
}
